X-ray inspection devices have conventionally been used to inspect commercial products in order to avoid shipping ones contaminated with foreign matter. In the X-ray inspection devices, an X-ray detection diagnostic test is carried out when the device is powered on. However, since the X-ray source in the X-ray inspection device will deteriorate over time, a proposed X-ray inspection device has a test mode, in addition to the diagnostic test carried out when the device is powered on, wherein the state of the device is assessed by inspecting a test piece including the foreign matter or the like, and detecting the test piece. (See Japanese Laid-Open Patent Application 2005-3481)